'use strict';

var _interopRequireWildcard = require('@babel/runtime/helpers/interopRequireWildcard');
Object.defineProperty(exports, '__esModule', {
  value: true,
});
exports.default = void 0;
var _react = _interopRequireWildcard(require('react'));
var defaultRenderItem = function defaultRenderItem(val) {
  return val
    ? /*#__PURE__*/ _react.default.createElement('span', {
        className: 'szzj-form-detail-img',
        style: {
          backgroundImage: val,
        },
      })
    : null;
};
var Tag = function Tag(props) {
  var valuePropName = props.valuePropName,
    _props$renderDetailIt = props.renderDetailItem,
    renderDetailItem = _props$renderDetailIt === void 0 ? defaultRenderItem : _props$renderDetailIt;
  var value = valuePropName ? props[valuePropName] : props.value;
  return /*#__PURE__*/ _react.default.createElement(
    _react.Fragment,
    null,
    Array.isArray(value)
      ? /*#__PURE__*/ _react.default.createElement(
          'div',
          {
            className: 'szzj-form-detail-tags',
          },
          value.map(function (val, index) {
            return /*#__PURE__*/ _react.default.createElement(
              'span',
              {
                key: index,
              },
              renderDetailItem(val),
            );
          }),
        )
      : renderDetailItem(value),
  );
};
var _default = Tag;
exports.default = _default;
